from stark.service.s1 import site, StarkHandler
from . import models
from rbac.models import UserInfo
from app_main.views.customer_private import CustomerPrivateHandler
from app_main.views.consult_record import ConsultRecordHandler
from app_main.views.customer_public import CustomerPublicHandler
from app_main.views.user_info import UserInfoHandler
from app_main.views.pay_record import PayRecordHandler
from app_main.views.check_pay_record import CheckPayRecordHandler
from app_main.views.student import StudentHandler
from app_main.views.score_record import ScoreRecordHandler
from app_main.views.class_list import ClassListHandler
from app_main.views.teach_record import TeachRecordHandler


class SchoolHandler(StarkHandler):
    list_display = [
        'title',
        StarkHandler.display_edit,
        StarkHandler.display_del
    ]


class DepartmentHandler(StarkHandler):
    list_display = [
        'title',
        StarkHandler.display_edit,
        StarkHandler.display_del
    ]


class CourseHandler(StarkHandler):
    list_display = [
        'name',
        StarkHandler.display_edit,
        StarkHandler.display_del
    ]


site.register(models.FollowRecord, ConsultRecordHandler)
site.register(models.Customer, CustomerPublicHandler, prev='public')
site.register(models.Customer, CustomerPrivateHandler, prev='private')
site.register(models.ClassList, ClassListHandler)
site.register(models.School, SchoolHandler)
site.register(models.Department, DepartmentHandler)
site.register(UserInfo, UserInfoHandler)
site.register(models.Course, CourseHandler)
site.register(models.PaymentRecord, PayRecordHandler)
site.register(models.PaymentRecord, CheckPayRecordHandler, prev='check')
site.register(models.Student, StudentHandler)
site.register(models.ScoreRecord, ScoreRecordHandler)
site.register(models.TeachRecord, TeachRecordHandler)
